<template>
	<view class="container">
		<view class="setList">
			<view class="setItem">
				<view class="verson">
					版本
				</view>
				<view class="versonValue">
					1.1.1
				</view>
			</view>

			<view class="setItem" @click="toAgreement()">
				<view class="text">
					协议
				</view>
				<view class="iconContent">
					<uni-icons type="right" size="15"></uni-icons>

				</view>
			</view>
		</view>

		<view class="logOut" @click="loginOut()" v-if="isLogOut">
			退出登录
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				isLogOut: false
			}
		},
		methods: {
			//退出登录
			loginOut() {
				uni.removeStorageSync('token');
				uni.$showMsg('退出登录成功')
				uni.$toPage('/pages/my/my')
			},
			toAgreement() {
				uni.$toPage('/subpkg/userAgreement/userAgreement')
			}


		},
		onLoad() {
			const token = uni.getStorageSync('token') || null;
			if (token) {
				this.isLogOut = true;
			}
		}
	}
</script>

<style lang="scss" scoped>
	.container {
		display: flex;
		align-items: center;

		.logOut {
			position: absolute;
			width: 400rpx;
			height: 80rpx;
			opacity: 1;
			border-radius: 26rpx;
			background: rgba(223, 161, 60, 1);
			display: flex;
			justify-content: center;
			align-items: center;
			font-size: 28rpx;
			font-weight: 500;
			letter-spacing: 0rpx;
			line-height: 40.54rpx;
			color: rgba(255, 255, 255, 1);
			bottom: 90rpx;
			left: 176rpx;



		}

		.setList {
			margin-top: 52rpx;
			width: 100%;
			display: flex;
			flex-direction: column;
			justify-content: center;
			align-items: center;

			padding: 0 40rpx;

			.setItem {
				width: 100%;
				margin-bottom: 44rpx;
				display: flex;
				justify-content: space-between;

				.verson {
					// 版本号的样式
				}

				.versonValue {
					// 版本值的样式
					font-size: 32rpx;
					font-weight: 400;
					letter-spacing: 0rpx;
					line-height: 46.34rpx;
					color: rgba(128, 128, 128, 1);
				}

				.text {
					// 文本的样式
					font-size: 32rpx;
					font-weight: 400;
					letter-spacing: 0rpx;
					line-height: 46.34rpx;
					color: rgba(0, 0, 0, 1);
				}

				.iconContent {
					// 图标内容的样式
					box-sizing: border-box;
					padding-right: 0;
					width: 48rpx;
					height: 48rpx;
					text-align: right;
					opacity: 1;

				}
			}
		}
	}
</style>